<?php
/**
 * Created by PhpStorm.
 * User: denh
 * Date: 16/7/27
 * Time: 下午6:57
 */

class IndexController extends BaseController {

    function downLoadApp() {
        require $this->template;
    }

    function suizheng() {

        $this->redirectToWeixinForOpenid();
        $token = $_SESSION['userCenter']['token'];

        if (G_SERV_ID == 13) {
            $url = "https://cdntac.babydr.cn/html/request/sz_index.html";
        } else {
            $url = "https://cdnac.babydr.cn/html/request/sz_index.html"; //正式
        }

        if ($token) {
            $url .= "?from=1&token=$token";
            header("Location:$url");
        }
    }

    function luke() {
        $this->redirectToWeixinForOpenid();
        $name = $_SESSION['vo用户数据']['name'];

        if (G_SERV_ID == 13) {
            $url = "http://webtest.cyyzjk.com/index.php?c=Index&m=lz_suizheng&from=1";
        } else {
            $url = "http://www.babydr.cn/index.php?c=Index&m=lz_suizheng&from=1"; //正式
        }
        if ($name) {
            $url .= "&name=$name";
            header("Location:$url");
        } else {
            echo '<script>location.href="'.$url.'";</script>';
        }
    }
    
    function happynewyear() {
        require $this->template;
    }

}